package conf;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.nio.charset.Charset;
import java.nio.charset.UnsupportedCharsetException;

public class AppConfig {
    private static final Logger logger = LoggerFactory.getLogger(AppConfig.class);
    public static Charset SYS_CHARSET = Charset.forName("UTF-8");

    static{
        String charset = System.getProperty("SYS_CHARSET");
        if(charset != null){
            try{
                SYS_CHARSET = Charset.forName(charset);
            }catch (UnsupportedCharsetException e){
                logger.error("Application of encoding {} initialization failed and the default encoding UTF-8 was used", charset);
            }
        }
    }

}
